﻿package  {
	
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	
	public class Drawer extends MovieClip {
		public var graf:Graf = null;
		
		public function Drawer() {
			genBtn.addEventListener(MouseEvent.CLICK, generuj);
			
		}
		public function generuj(e:MouseEvent) {
			if(graf!=null) {
				this.removeChild(graf);
				graf=null;
			}
			graf = new Graf(lineTxt.text);
			this.addChild(graf);
			graf.y = 30;
			
		}
	}
	
}
